package com.ossjk.qlh.system.controller;

import java.util.HashMap;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ossjk.core.base.controller.BaseController;
import com.ossjk.core.util.OsUtil;
import com.ossjk.core.vo.ResponseBean;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "系统信息")
@RestController
@RequestMapping("/system/systeminfo")
public class SysteminfoController extends BaseController {

	@ApiOperation(value = "获取")
	@PostMapping(value = "/getOsInfo")
	@RequiresPermissions("00000040")
	public ResponseBean<Map<String, Object>> getOsInfo() {
		Map<String, Object> data = new HashMap();
		data.put("cpuInfo", OsUtil.getCpuInfo());
		data.put("osMemory", OsUtil.getOsMemory());
		data.put("jvmInfo", OsUtil.getJvmInfo());
		data.put("osInfo", OsUtil.getOsInfo());
		return responseSuccess(data);
	}
}
